package com.gk.study.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

@Data
@NoArgsConstructor
@TableName("b_hwork")
public class Homework {
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @TableField("course_id")
    private Long courseId;

    @TableField("teacher_id")
    private Long teacherId;

    @TableField("student_id")
    private Long studentId;

    @TableField("course_title")
    private String courseTitle;

    @TableField("teacher_name")
    private String teacherName;

    @TableField("title")
    private String title;

    @TableField("description")
    private String description;

    @TableField("attachment")
    private String attachment;

    @TableField("publish_time")
    private LocalDateTime publishTime;

    @TableField("deadline")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") // 添加格式注解
    private LocalDateTime deadline;

    @TableField("status")
    private Integer status; // 0-未完成 1-待批改 2-已批改

    @TableField("score")
    private Double score;

    @TableField("student_answer")
    private String studentAnswer;

    @TableField("student_attachment")
    private String studentAttachment;

    @TableField(exist = false)
    private String courseCover; // 非数据库字段
}